/*
* $Id: Exception.cpp 2 2009-12-23 13:58:02Z volok-aleksej@yandex.ru $
*
* Copyright 2007 by Volokitin Alexey
* All rights reserved
*
*/
#include "Common/include.h"
#include "Exception.h"

CBaseError::CBaseError(const std::tstring& strFileName, const std::tstring& strFunction, int nLine, const std::tstring& strError)
{
	m_strFunction = strFunction;
	m_strFileName = strFileName;
	m_strError = strError;
	m_nLine = nLine;
}
CBaseError::CBaseError( const std::tstring& strFileName, const std::tstring& strFunction, int nLine, int param1, int param2 )
{
	m_strFunction = strFunction;
	m_strFileName = strFileName;
	m_nLine = nLine;
	TCHAR val[10];
	memset(val, 0, 10*sizeof(TCHAR));
	_itot_s(param1, val, 10, 10);
	m_strError.append(_T("\nParameter 1 of Error: "));
	m_strError.append(val);
	_itot_s(param2, val, 10, 10);
	m_strError.append(_T("\nParameter 2 of Error: "));
	m_strError.append(val);
}
std::tstring CBaseError::GetError()
{
	CString str;
	str.Format(_T("Error: %s\nFile: %s\nFunction: %s\nLine:%d"), m_strError.c_str(), m_strFileName.c_str(), m_strFunction.c_str(), m_nLine);
	return std::tstring(str.GetString());
}